<?php
declare(strict_types=1);

return [
    [
        'type' => 'switch',
        'field' => 'is_cache',
        'title' => '缓存开关',
        'info' => '是否开启新闻数据缓存',
        '$required' => false,
        'props' => [
            'activeValue' => true,
            'inactiveValue' => false
        ],
        '_fc_id' => 'id_news_cache',
        'name' => 'ref_news_cache',
        'display' => true,
        'hidden' => false,
        '_fc_drag_tag' => 'switch'
    ],
    [
        'type' => 'input-number',
        'field' => 'list_page_size',
        'title' => '列表页大小',
        'info' => '新闻列表每页显示的数量',
        '$required' => true,
        'props' => [
            'min' => 5,
            'max' => 50,
            'defaultValue' => 20
        ],
        '_fc_id' => 'id_news_page_size',
        'name' => 'ref_news_page_size',
        'display' => true,
        'hidden' => false,
        '_fc_drag_tag' => 'input-number'
    ],
    [
        'type' => 'select',
        'field' => 'default_order',
        'title' => '默认排序',
        'info' => '新闻列表默认排序方式',
        '$required' => true,
        'props' => [
            'options' => [
                [
                    'label' => '创建时间降序',
                    'value' => 'create_time_desc'
                ],
                [
                    'label' => '创建时间升序',
                    'value' => 'create_time_asc'
                ],
                [
                    'label' => '浏览量降序',
                    'value' => 'views_desc'
                ],
                [
                    'label' => '浏览量升序',
                    'value' => 'views_asc'
                ]
            ],
            'defaultValue' => 'create_time_desc'
        ],
        '_fc_id' => 'id_news_order',
        'name' => 'ref_news_order',
        'display' => true,
        'hidden' => false,
        '_fc_drag_tag' => 'select'
    ],
    [
        'type' => 'switch',
        'field' => 'enable_comment',
        'title' => '开启评论',
        'info' => '是否允许用户对新闻进行评论',
        '$required' => false,
        'props' => [
            'activeValue' => true,
            'inactiveValue' => false
        ],
        '_fc_id' => 'id_news_comment',
        'name' => 'ref_news_comment',
        'display' => true,
        'hidden' => false,
        '_fc_drag_tag' => 'switch'
    ],
    [
        'type' => 'group',
        'field' => 'category_settings',
        'title' => '分类设置',
        'info' => '新闻分类相关设置',
        '$required' => false,
        'props' => [
            'rule' => [
                [
                    'type' => 'fcRow',
                    'children' => [
                        [
                            'type' => 'col',
                            'props' => [
                                'span' => 12
                            ],
                            'children' => [
                                [
                                    'type' => 'switch',
                                    'field' => 'enable_multi_level',
                                    'title' => '多级分类',
                                    'info' => '是否启用多级分类结构',
                                    '$required' => false,
                                    'props' => [
                                        'activeValue' => true,
                                        'inactiveValue' => false
                                    ],
                                    '_fc_id' => 'id_news_multi_level',
                                    'name' => 'ref_news_multi_level',
                                    'display' => true,
                                    'hidden' => false,
                                    '_fc_drag_tag' => 'switch'
                                ],
                                [
                                    'type' => 'input-number',
                                    'field' => 'max_level',
                                    'title' => '最大层级',
                                    'info' => '分类最大层级数',
                                    '$required' => false,
                                    'props' => [
                                        'min' => 1,
                                        'max' => 5,
                                        'defaultValue' => 3
                                    ],
                                    '_fc_id' => 'id_news_max_level',
                                    'name' => 'ref_news_max_level',
                                    'display' => true,
                                    'hidden' => false,
                                    '_fc_drag_tag' => 'input-number'
                                ]
                            ]
                        ]
                    ]
                ]
            ]
        ]
    ]
];